package com.rgs.se.leecode;


import com.rgs.se.leecode.base.ListNode;

/**
 * @author Ren Gaoshuai
 * @ClassName P203
 * @date 2022-04-07 22:36
 **/
public class P203Recursion {
    public ListNode removeElements(ListNode head, int val) {
        if (head == null){
            return null;
        }
        ListNode listNode = removeElements(head.next, val);
        if (head.val == val){
            return listNode;
        }else{
            head.next = listNode;
            return head;
        }
    }
}

